package com.base.cn.platform.os.controller.mobile.classes.topic;

import com.base.cn.platform.os.common.MobileBaseController;
import com.base.cn.platform.os.service.course.classes.topic.report.ClassesTopicReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Map;

/**
 * H5班级话题举报Controller
 *
 * @author zsw
 * @create 2018/7/5
 */
@Controller
@RequestMapping("/mobile/uc/class/topic")
public class MobileClassTopicReportController extends MobileBaseController {
    @Autowired
    private ClassesTopicReportService classesTopicReportService;

    /**
     * 保存话题举报
     *
     * @param report 话题举报数据
     */
    @RequestMapping("/ajax/save/report")
    @ResponseBody
    public Map<String, Object> saveTopicReport(HttpServletRequest request,
                                               @RequestBody Map<String, Object> report) {
        BigDecimal userId = webMobileLoginUtil.getLoginUserId(request);
        report.put("userId",userId);
        return classesTopicReportService.saveClassesTopicReport(report);
    }

}
